 #!/bin/bash

WEB_PATH='/var/www/darkserver/'$1
WEB_USER='root'
WEB_USERGROUP='root'

echo "Start deployment"
cd $WEB_PATH
echo "pulling source code..."
git reset --hard origin/master
git clean -f
git pull
git checkout master
echo "changing permissions..."
chown -R $WEB_USER:$WEB_USERGROUP $WEB_PATH
echo "Finished."

#进入目录
cd /home/server/qqrobot/
#停止qq
pm2 delete qq
# 删除缓存文件
rm -rf public/images/yulist.jpg
rm -rf public/images/youlist.jpg
rm -rf public/images/miaolist.jpg
#拉取
git pull
#启动qq
pm2 start ./bin/www --name qq
